Passed
Push — feature/player-stats ( ea44e6...56b8d9 )
by Kevin Van
04:46
created

Card   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 21
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 1
1
import React, {FunctionComponent} from "react"
2
import classNames from "classnames"
3
4
import Icon from "./Icon"
5
6
import "./Card.scss"
7
8
const Card: FunctionComponent<CardProps> = ({
9
  className,
10
  hasTable,
11
  title,
12
  titleIcon,
13
  children,
14
}) => (
15
  <article
16
    className={classNames("card", className, {
17
      "card--has-table": hasTable,
18
    })}
19
  >
20
    <header className={"card__header"}>
21
      <h4>
22
        {titleIcon !== "" && <Icon icon={titleIcon} />} {title}
23
      </h4>
24
    </header>
25
    <div className={"card__content"}>{children}</div>
26
  </article>
27
);
28
29
Card.defaultProps = {
30
  className: "",
31
  hasTable: false,
32
  titleIcon: "",
33
}
34
35
export default Card
36